/* 使用替换的必须用这个 */
// #define PTHREADALT_CUSTOM_CONTRUCTOR
#define METALC_DYNLIB

#include <metalc/mlos/tsysmalloc.h>


#define NOT_REPLACE_USABLE_SIZE
#include <metalc/mlapi/malloc.h>
#include <metalc/base/mtls.h>
/* tapdsnode, 如果使用就需要 */

DEF_POBJ_PHEAP(mlcc, 2 * 1024 * 1024)
SAI void *mlcc_palloc(size_t size){ return pheap_palloc_mlcc(size); }

/* 定义allocator */
COMPOSE_MLAYER(test, mallocapi, tsysmalloc)

DEF_MTLS_PTHREAD(GET_MLAYER_OBJNR(test), 4096, mlcc_palloc, mp_coreid)


/* 对于库需要手动触发初始化, 如何做到? */
/* mlcc和mtls一定要放在第一位初始化 */
DEF_SYSINIT(test, mtls)
DEF_CFLOWFIN(mtls)
DEF_CFLOWINIT(test, mtls)
DEF_SYSFIN(__omega)